<div class="waypoint container">
    <div class="row">
        <div class="col-md-12">
            <h2 class="page-title">Usuários</h2>
        </div>
        
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li><a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'index'))?>">Admin</a></li>
                <li>Usuarios</li>
            </ol>
        </div>
        

        <div class="col-md-12">
            <div class="alert alert-info" style="width: 100%; text-align: center">
                Existem <?php echo count($this->users); ?> usuários cadastrados.
            </div>
            <br /><br />
            
            <table class="table">
                <thead>
                  <tr>
                    <th>ID</th>
                    <th>Nome</th>
                    <th>E-mail</th>
                    <th>Status</th>
                    <th>Registro</th>
                    <th>Ações</th>
                  </tr>
                </thead>
                <tbody>
                  <?php foreach($this->users AS $user) { ?>
                    <tr>
                      <td><?php echo $user['id']; ?></td>
                      <td><a href="<?php echo $user['url']; ?>">
                          <?php if ($user['admin'] == 1) { ?>  <span class="fa fa-bolt" style="color: goldenrod"></span>  <?php } ?>
                          <?php echo $user['name']; ?>
                          <span class="fa fa-<?php echo $user['kind']; ?>"></span>
                      </a></td>
                      <td><?php echo $user['email']; ?></td>
                      <td><?php if($user['active'] == 1) { ?>
                          <span class="btn btn-success disabled">Ativo</span>
                      <?php } else { ?>
                          <span class="btn btn-danger disabled">Banido</span>
                      <?php } ?>
                      </td>
                      <td><?php echo date("d/m/Y H:i", strtotime($user['created_at'])); ?></td>
                      <td><?php if($user['active'] == 1) { ?>
                              <a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'banir-usuario', 'user' => $user['id']))?>" class="btn btn-small btn-danger"><span class="fa fa-ban"></span> Banir</a>
                          <?php } else { ?>
                            <a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'banir-usuario', 'user' => $user['id']))?>" class="btn btn-small btn-success"> Desbanir</a>
                          <?php } ?> 
                      </td>
                    </tr>
                  <?php } ?>
                </tbody>
              </table>
            <br /><br /><br /><br />
        </div><!-- end .col-md-12 -->

    </div><!-- end .row -->
</div><!-- end section -->
